/**
 *  Company    : Sysnet Pioneer Solutions
 *  License    : MIT License
 *  Document   : sysnet_pioneer-dom_get.js
 *  Created on : Dec 2, 2011, 6:44:44 PM
 *  Author     : SERVER
 *  Template   : jQuery plugin
 */

(function($){
    
    // put your code here
    $.set.dom_get = {
        
        
        
    }
    
    /**
     * Retrieves the name of the element [input | textarea | select ]     *  
     */
    
    $.dom_get = function(){
        
        var $this = this;
        var load = 1;
        
        // defaults
        var sizzle, elem = {};
        
        if(typeof($this) == "function")load=1;
        else if(typeof($this.append) == "function")load=2;
        else return;
      
        $.overload([
            
            function(){
                
                sizzle = $("html");
                
            }
            ,function(){
                
                sizzle = $this;
                
            }
            
        ],load)
        
        var name, value, $each;
                
        sizzle.find("[name|=]").each(function(){
             
             $each = $(this);
             if((!$each.is_checked()) && $each.is("[type=radio],[type=checkbox]"))return;
             
             name = $each.attr("name");
             value = $each.val();
                         
             elem[name] = value;
        });
        
        return elem;
    }
    
    $.fn.dom_get = $.dom_get;
})(jQuery)